package cn.practice.chat.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * @ClassName AppRunner
 * @Description:
 * @Author A-TAO
 * @Date 2022/10/31
 * @Version V1.0
 **/
@Slf4j
@Component
public class AppRunner implements CommandLineRunner {

    @Value("${netty.port}")
    private int port;

    @Value("${netty.name}")
    private String name;


    @Value("${spring.cloud.nacos.discovery.server-addr}")
    private String nacosServer;



    @Override
    public void run(String... args) throws Exception {
        log.info("开始启动netty");
        WebSocket.action(name, port, nacosServer);
    }
}
